package cinema.ELTEcinema;

import java.io.Serializable;

import javax.annotation.PostConstruct;
import javax.enterprise.context.SessionScoped;
import javax.inject.Inject;
import javax.inject.Named;

import cinema.ELTEcinema_ejb.ExampleBean;
import cinema.ELTEcinema_ejb.Dao.UserDAO;
import cinema.ELTEcinema_ejb.Entity.User;

@SuppressWarnings("serial")
@Named
@SessionScoped
public class JsfBean implements Serializable{

	@Inject
	private ExampleBean _bean;
	
	@Inject
	private UserDAO userDAO;
	
	private String text;
	private User user;
	
	@PostConstruct
	public void init(){
		text=_bean.getData();
		user=userDAO.findAll().get(0);
	}
	
	public String getText() {
		return text;
	}

	public void setText(String text) {
		this.text = text;
	}

	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}
}
